<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../../WebPlugin/jquery-easyui/themes/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="../../../WebPlugin/jquery-easyui/themes/icon.css"/>
<script type="text/javascript" src="../../../WebPlugin/jquery-easyui/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="../../../WebPlugin/jquery-easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../../../WebPlugin/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
<title>三月物业管理系统_用户登录</title>
<link href="images/login.css" rel="stylesheet" type="text/css" />
 <style type="text/css">
      html, body, h1, h2, h3, h4, h5, h6, hr, p, blockquote, dl, dt, dd, ul, ol, li, form, fieldset, legend, button, input, select, textarea, th, td {margin: 0;padding: 0;}
      body{background-color:#70ad21 }
</style>
<script language="javascript">

   
   //异步请求
    function requestAjax(requestUrl, requestData, callback,errcallback) {
        $.ajax({
            type: "POST",
            url: requestUrl,
            data: requestData,
            success: function(msg) {
                var retobject = eval('(' + msg + ')');
                if (retobject.ret == 0) {//后台操作成功
                    if (callback)
                        callback(retobject.data);
                }else{
                    if (errcallback)
                        errcallback();
                }
                if (retobject.msg != '') {
                    //alert("结果: " + retobject.msg);
                    $.messager.alert('提示', "结果: " + retobject.msg, 'info');
                }
            }
        });
    }
      
  function doSubmit() {
        var strUserTitle = document.getElementById("txtUserName").value;
        if (strUserTitle == "") {
            $.messager.alert('提示', "用户名不能为空", 'info');
            return false;
        }
        var strUserPWD = document.getElementById("txtUserPWD").value;
        if (strUserPWD == "") {
            $.messager.alert('提示', "密码不能为空", 'info');
            return false;
        }
        $.messager.progress({
            title: '登录',
            msg: '正在登录中请等待...'
        });
        
        requestAjax('Controller.aspx?controller=LoggingController&method=Login', {txtUserName:$('#txtUserName').val(),txtUserPWD:$('#txtUserPWD').val(),txtUserIP:$('#txtUserIP').val(),txtMac:$('#txtMac').val()}, function(data) {
            $.messager.progress('close');
            window.location.href='login.aspx';
        },function(){$.messager.progress('close');});
    }

    function clearTxt() {
        $('#txtUserName').val('').focus();
        $('#txtUserPWD').val('');
    }
    
    $(function(){
        $("#txtUserName").keydown(function(e){
          if(e.keyCode==13)
          {
            $("#txtUserPWD").focus();
          }       
        });
          
        $("#txtUserPWD").keydown(function(e){
          if(e.keyCode==13)
          { 
                //如果调用doSubmit()方法验证会失效!
                var strUserTitle = document.getElementById("txtUserName").value;
                if (strUserTitle == "") {
                    $.messager.alert('提示', "用户名不能为空", 'info');
                    return false;
                }
                var strUserPWD = document.getElementById("txtUserPWD").value;
                if (strUserPWD == "") {
                    $.messager.alert('提示', "密码不能为空", 'info');
                    return false;
                }
                $.messager.progress({
                    title: '登录',
                    msg: '正在登录中请等待...'
                });
                requestAjax('Controller.aspx?controller=LoggingController&method=Login', {txtUserName:$('#txtUserName').val(),txtUserPWD:$('#txtUserPWD').val(),txtUserIP:$('#txtUserIP').val(),txtMac:$('#txtMac').val()}, function(data) {
                    window.location.href='login.aspx';
                    $.messager.progress('close');
                },function(){$.messager.progress('close');});
          }         
        });
    });
    
    window.onload = function() {
        document.getElementById("txtUserName").focus();
    }
</script>
</head>

<body>

<form  id="frmlogin" method="post"  target="_self">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td bgcolor="9fc967">&nbsp;</td>
  </tr>
  <tr>
    <td height="604"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="604" background="images/login_02.gif">&nbsp;</td>
        <td width="989"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="345" background="images/login_1.jpg">&nbsp;</td>
          </tr>
          <tr>
            <td height="47"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="539" height="47" background="images/login_05.gif" nowrap="nowrap">&nbsp;</td>
                <td width="206" background="images/login_06.gif" nowrap="nowrap"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="17%" height="22"><div align="center"><span class="STYLE1">用户</span></div></td>
                    <td width="58%" height="22"><div align="center">
                        <input name="txtUserName" id="txtUserName" maxlength="30" type="text" size="15" style="height:20px; border:solid 1px #bbbbbb">
                    </div></td>
                    <td width="25%" height="22">&nbsp;</td>
                  </tr>
                  <tr>
                    <td height="22"><div align="center"><span class="STYLE1">密码</span></div></td>
                    <td height="22"><div align="center">
                        <input name="txtUserPWD" id="txtUserPWD" maxlength="30" type="password" size="15" style="height:20px; border:solid 1px #bbbbbb">
                    </div></td>
                    <td height="22"><div align="center" onclick="doSubmit();"><img src="images/dl.gif" width="39" height="18"></div></td>
                  </tr>
                </table></td>
                <td width="244" background="images/login_07.gif" nowrap="nowrap">&nbsp;</td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td height="212" background="images/login_08.gif">&nbsp;</td>
          </tr>
        </table></td>
        <td background="images/login_04.gif">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td bgcolor="70ad21">&nbsp;</td>
  </tr>
</table>
    <INPUT type="hidden" name="txtMac" id="txtMac" value=""/>
	<INPUT type="hidden" id="txtUserIP" name="txtUserIP" value="<% =strUserIP %>"/>
</form>
</body>
</html>
